<div class="page-body">
    <a class="btn btn-default maroon" style="margin-bottom: 15px;">
        <form action="{:U('import')}" method="post" enctype="multipart/form-data">
            图书编目导入:&nbsp;&nbsp;
            <input type="file" name="excel" style="display: inline">
            <input type="submit" value="确认导入-覆盖,新华码(spbs)唯一,为查找索引值" />
            <span>注:此处导入不会覆盖库存</span>
        </form>
    </a><br>
    <a class="btn btn-default maroon" style="margin-bottom: 15px;">
        <form action="{:U('importType')}" method="post" enctype="multipart/form-data">
            图书分类导入:&nbsp;&nbsp;
            <input type="file" name="excel_type" style="display: inline">
            <input type="submit" value="确认覆盖,新华码(spbs)唯一,为查找索引值" />
            <span></span>
        </form>
    </a><br>
    <a class="btn btn-default purple" href="{:U('add')}" style="margin-bottom: 15px;"><i class="fa fa-plus"></i>
        新增图书
    </a>
    <a class="btn btn-default purple" href="{:U('export')}" style="margin-bottom: 15px;"><i class="glyphicon glyphicon-cloud-download"></i>
        导出图书
    </a>
    <div class="row">
        <div class="col-xs-12 col-md-12">
            <div class="widget">
                <div class="widget-header ">
                    <span class="widget-caption">书籍列表</span>
                    <div class="widget-buttons">
                        <a href="#" data-toggle="maximize">
                            <i class="fa fa-expand"></i>
                        </a>
                        <a href="#" data-toggle="collapse">
                            <i class="fa fa-minus"></i>
                        </a>
                        <a href="#" data-toggle="dispose">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="table-toolbar">
                        <form method="get" action="{:U('index')}" class="form-inline" role="form">
                            <div class="form-group">
                                <span class="input-icon" style="width: 200px;">
                                    <input type="text" class="form-control input-sm" placeholder="新华码、条码、ID、书名"
                                           name="keywords" value="{$Think.get.keywords}">
                                    <i class="glyphicon glyphicon-search blue"></i>
                                </span>
                                <div class="input-group">
                                    信息不全:
                                    <select name="is_null">
                                        <option value="0" <eq name="Think.get.is_null" value="0">selected=selected</eq> >--请选择--</option>
                                        <option value="b_logo" <eq name="Think.get.is_null" value="b_logo">selected=selected</eq> >封面图片</option>
                                        <option value="bdetail" <eq name="Think.get.is_null" value="bdetail">selected=selected</eq> >图书详情</option>
                                        <option value="b_rec" <eq name="Think.get.is_null" value="b_rec">selected=selected</eq> >图书推荐语</option>
                                        <option value="type" <eq name="Think.get.is_null" value="b_rec">selected=selected</eq> >图书分类</option>
                                    </select>
                                </div>
                                <button type="submit" class="btn btn-info">搜索</button>
                                <a class="btn btn-warning action-btn" data-href="{:U('export')}">导出全部</a>
                                <a class="btn btn-warning action-btn" data-href="{:U('export_where')}?keywords={$Think.get.keywords}&is_null={$Think.get.is_null}">导出当前</a>

                            </div>
                        </form>


                    </div>
                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>
                                ID
                            </th>
                            <th>
                                条码
                            </th>
                            <th>
                                书名
                            </th>
                            <th>
                                类别
                            </th>
                            <th>
                                定价
                            </th>
                            <th> 库存</th>
                            <th>推荐语</th>
                            <th>排序</th>
                            <th></th>
                        </tr>
                        </thead>

                        <tbody>
                        <foreach name="data" item="v">
                            <tr>
                                <td>
                                    {$v.book_id}
                                </td>
                                <td>
                                    条码：{$v.tm}<br>
                                    新华码：{$v.spbs}
                                </td>
                                <td>
                                    <img src="{$v.b_logo}" width="100"><br>
                                    书名：{$v.sm}<br>
                                    作者：{$v.zyz}
                                </td>
                                <td>
                                    <foreach name="v.book_type" item="book_type">
                                        {$book_type.p_name}：{$book_type.name}<br>
                                    </foreach>
                                </td>
                                <td>
                                    {$v.dj}
                                </td>
                                <td>
                                    借：{$v.stock_rent}<br>
                                    卖：{$v.stock_buy}<br>
                                    占用：{$v.stock_zhan}<br>
                                    借出：{$v.stock_jie}<br>
                                    缺失：{$v.stock_que}
                                </td>
                                <td>
                                    {$v.b_rec|substr=0,100}
                                </td>
                                <td>{$v.sort}</td>
                                <td>
                                    <a class="btn btn-danger btn-xs del-btn" href="javascript:;"
                                       data-href="{:U('del',array('book_id'=>$v['book_id']))}"><i
                                            class="fa fa-trash-o"></i></a>
                                    <a class="btn btn-info btn-sm"
                                       href="{:U('edit',array('book_id'=>$v['book_id']))}">
                                        <i class="fa fa-edit"></i> 编辑
                                    </a>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    {$page}
                    <form class="form-inline" method="post">
                        <div class="form-group">
                            <div class="input-group">
                                <div class="input-group-addon">设置页码</div>
                                <input class="form-control" type="text" placeholder="" name="p" value="{$Think.get.p}" style="width: 60px;">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>